package com.yami.shop.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.bean.dto.SkuStockLockDTO;
import com.yami.shop.bean.model.Order;
import com.yami.shop.bean.model.SkuStockLock;
import com.yami.shop.common.response.ServerResponseEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 库存锁定信息
 *
 * @author lhd
 * @date 2022-05-06 17:27:53
 */
public interface SkuStockLockService extends IService<SkuStockLock> {

    /**
     * 锁定库存
     * @param skuStockLocksParam 参数
     * @param orders
     * @return 是否成功
     */
    ServerResponseEntity<?> lock(List<SkuStockLockDTO> skuStockLocksParam, List<Order> orders);

    /**
     * 根据订单号进行库存解锁
     * @param orders 订单信息
     */
    void unlockStock(List<Order> orders);
    /**
     * 正式锁定库存，标记为使用状态
     * @param orderNumbers 订单编号
     */
    void markerStockUse(List<String> orderNumbers);


    void openBoxMarkerStockUse(Long prodId, Integer num);
}
